

class HomeOrderListModel {
  List<HomeOrderModel> orderModels;
  List<HomeAdsModel> orderAdsModels;
  HomeOrderListModel({this.orderModels, this.orderAdsModels});
  HomeOrderListModel.fromJson(Map<String, dynamic> json) {
   
    if (json['lists'] != null) {
      orderModels = List<HomeOrderModel>();
      json['lists'].forEach((v) {
        orderModels.add(HomeOrderModel.fromJson(v));
      });
    }
    if (null != json['ads']) {
      orderAdsModels = List<HomeAdsModel>();
      json['ads'].forEach((v) {
        orderAdsModels.add(HomeAdsModel.fromJson(v));
      });
    }
  }
}

class HomeOrderModel {
  String id;
  String proName;
  String createTime;
  String robName;
  String proStyle;
  String number;
  String price;
  String endTime;
  String distance;
  String uhead;
  String robType;
  String robTotal;
  String robNum;
  String get  tagImagesStr{
    return int.parse(robType) == 1?'tag_red.png':int.parse(robType) == 2?'tag_blue.png':'tag_blue.png';
  }
  String get  robTypeStr{
    return int.parse(robType) == 1?'抢单':int.parse(robType) == 2?'普通':'';
  }
  HomeOrderModel(
      {this.id,
      this.proName,
      this.createTime,
      this.robName,
      this.proStyle,
      this.number,
      this.price,
      this.endTime,
      this.distance,this.uhead,this.robType,this.robNum,this.robTotal});

  HomeOrderModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    proName = json['proName'];
    createTime = json['createTime'];
    robName = json['robName'];
    proStyle = json['proStyle'];
    number = json['num'];
    price = json['price'];
    endTime = json['endTime'];
    distance = json['distance'];
    uhead=json['uhead'];
     robType=json['robType'];
      robNum=json['robNum'];
       robTotal=json['robTotal'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['proName'] = this.proName;
    data['createTime'] = this.createTime;
    data['robName'] = this.robName;
    data['proStyle'] = this.proStyle;
    data['num'] = this.number;
    data['price'] = this.price;
    data['endTime'] = this.endTime;
    data['distance'] = this.distance;
    return data;
  }
}

class HomeAdsModel {
  String img;
  String link;
  HomeAdsModel({this.img, this.link});

  HomeAdsModel.fromJson(Map<String, dynamic> json) {
    img = json['img'];
    link = json['link'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['img'] = this.img;
    data['link'] = this.link;
    return data;
  }
}
